<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>实践一下--Neo4j | Celts</title><meta name="author" content="PaulGeorge"><meta name="copyright" content="PaulGeorge"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="实践是检验真理的唯一标准  本篇着重介绍一下 Neo4j      写在前面 为啥要使用 Neo4j？ MySQL 不好用了吗？  No、No、No！因为最近的工作中遇到了一些知识图谱的工作，自然就用到了图数据库， NoSQL 数据库可以很好的展示节点之间的关联关系，对于一些图谱的关系操作是很好的选择哦～ Neo4j官网">
<meta property="og:type" content="article">
<meta property="og:title" content="实践一下--Neo4j">
<meta property="og:url" content="https://curry3035.gitee.io/posts/3633/index.html">
<meta property="og:site_name" content="Celts">
<meta property="og:description" content="实践是检验真理的唯一标准  本篇着重介绍一下 Neo4j      写在前面 为啥要使用 Neo4j？ MySQL 不好用了吗？  No、No、No！因为最近的工作中遇到了一些知识图谱的工作，自然就用到了图数据库， NoSQL 数据库可以很好的展示节点之间的关联关系，对于一些图谱的关系操作是很好的选择哦～ Neo4j官网">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://curry3035.gitee.io/img/avatar.jpg">
<meta property="article:published_time" content="2021-09-01T01:00:00.000Z">
<meta property="article:modified_time" content="2022-05-26T18:18:41.536Z">
<meta property="article:author" content="PaulGeorge">
<meta property="article:tag" content="Neo4j">
<meta property="article:tag" content="NoSQl">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://curry3035.gitee.io/img/avatar.jpg"><link rel="shortcut icon" href="/img/ic.ico"><link rel="canonical" href="https://curry3035.gitee.io/posts/3633/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":false,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: true
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: PaulGeorge","link":"链接: ","source":"来源: Celts","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#1f1f1f","position":"top-right"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '实践一下--Neo4j',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2022-05-27 02:18:41'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/background.css"><link rel="stylesheet" href="/css/my.css"><meta name="generator" content="Hexo 5.4.2"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">64</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">25</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-archive"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-folder-open"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/photos/"><i class="fa-fw fa fa-camera-retro"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@img/mig2023/background05.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="Celts"><span class="site-name">Celts</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-archive"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-folder-open"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/photos/"><i class="fa-fw fa fa-camera-retro"></i><span> 图库</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">实践一下--Neo4j</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-09-01T01:00:00.000Z" title="发表于 2021-09-01 09:00:00">2021-09-01</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2022-05-26T18:18:41.536Z" title="更新于 2022-05-27 02:18:41">2022-05-27</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">2.2k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>10分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="实践一下--Neo4j"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><blockquote>
<p>实践是检验真理的唯一标准</p>
</blockquote>
<p><strong>本篇着重介绍一下 Neo4j</strong></p>
<hr>
<img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/neo4j_logo.png" style="zoom: 33%;" />



<p><strong>写在前面</strong></p>
<p><font color=#008000>为啥要使用 Neo4j？ MySQL 不好用了吗？</font></p>
<p> No、No、No！因为最近的工作中遇到了一些知识图谱的工作，自然就用到了图数据库， NoSQL 数据库可以很好的展示节点之间的关联关系，对于一些图谱的关系操作是很好的选择哦～</p>
<p><a target="_blank" rel="noopener" href="https://neo4j.com/">Neo4j官网</a></p>
<span id="more"></span>



<h3 id="Neo4j-介绍"><a href="#Neo4j-介绍" class="headerlink" title="Neo4j 介绍"></a>Neo4j 介绍</h3><h4 id="Neo4j-是什么"><a href="#Neo4j-是什么" class="headerlink" title="Neo4j 是什么"></a>Neo4j 是什么</h4><p> Neo4j 是图数据库中的佼佼者，采用 Java 编写，社区版已开源，商业版需收费。</p>
<p>Neo4j 是一个高性能的 NoSQL 图形数据库（Graph Database），它将结构化数据存储在网络上而不是表中。它是一个嵌入式的、基于磁盘的、具备完全的事务特性的 Java 持久化引擎，但是它将结构化数据存储在网络(从数学角度叫做图)上而不是表中。Neo4j 也可以被看作是一个高性能的图引擎，该引擎具有成熟数据库的所有特性。Neo4j 拥有十分酷炫的可视化界面，这是一般图数据库所不具备的。</p>
<p>在一个图中包含两种基本的数据类型：<strong>Nodes</strong>（节点） 和 <strong>Relationships</strong>（关系）。Nodes 和 Relationships 包含 key / value 形式的属性。Nodes通过 Relationships 所定义的关系相连起来，形成关系型网络结构。</p>
<img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_00-53-49.png" style="zoom: 80%;" />





<h4 id="Neo4j-概览"><a href="#Neo4j-概览" class="headerlink" title="Neo4j 概览"></a>Neo4j 概览</h4><p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_02-38-08.png"></p>
<p>在上述例子中，共有两类节点：City 和 Company，一类关系：(Company) -[belongTo]-&gt; (City)。</p>
<h3 id="Neo4j-使用-Cypher"><a href="#Neo4j-使用-Cypher" class="headerlink" title="Neo4j 使用 [Cypher]"></a>Neo4j 使用 [Cypher]</h3><h4 id="Add"><a href="#Add" class="headerlink" title="Add"></a>Add</h4><p>City的节点可以通过使用如下命令使用：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">create (city: City&#123;name: &quot;上海市&quot;, area: &quot;6340.5平方千米&quot;, population: &quot;2487.09万人&quot;, alias: [&quot;沪&quot;, &quot;申&quot;]&#125;);</span><br><span class="line">create (city: City&#123;name: &quot;北京市&quot;, area: &quot;16410平方千米&quot;, population: &quot;2189.31万人&quot;, alias: [&quot;京&quot;, &quot;帝都&quot;]&#125;);</span><br><span class="line">create (city: City&#123;name: &quot;深圳市&quot;, area: &quot;1997.49平方千米&quot;, population: &quot;1756万人&quot;, alias: [&quot;深&quot;, &quot;鹏城&quot;]&#125;);</span><br><span class="line">create (city: City&#123;name: &quot;杭州市&quot;, area: &quot;16850平方千米&quot;, population: &quot;1193万人&quot;, alias: [&quot;杭&quot;]&#125;);</span><br></pre></td></tr></table></figure>

<p>在上述语句中，create表示新建，小括号内是节点信息，节点的类型（label）是City，city是其别名，花括号内是该节点的属性，共有name、area、population、alias四个属性。<strong>注意：Neo4j支持列表这个数据类型，但不支持时间日期这个数据类型。</strong></p>
<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_01-03-47.png"></p>
<p>  Company的节点可以通过使用如下命令使用：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">create (company: Company&#123;name: &quot;阿里&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;网易&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;百度&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;字节跳动&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;新浪&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;拼多多&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;B站&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;小红书&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;华为&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;腾讯&quot;&#125;);</span><br><span class="line">create (company: Company&#123;name: &quot;招商银行&quot;&#125;);</span><br></pre></td></tr></table></figure>

<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_01-05-46.png"></p>
<p>创建关系的命令如下：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (city: City&#123;name: &quot;杭州市&quot;&#125;), (company: Company&#123;name: &quot;阿里&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;杭州市&quot;&#125;), (company: Company&#123;name: &quot;网易&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;上海市&quot;&#125;), (company: Company&#123;name: &quot;拼多多&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;上海市&quot;&#125;), (company: Company&#123;name: &quot;B站&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;上海市&quot;&#125;), (company: Company&#123;name: &quot;小红书&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;北京市&quot;&#125;), (company: Company&#123;name: &quot;新浪&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;北京市&quot;&#125;), (company: Company&#123;name: &quot;百度&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;北京市&quot;&#125;), (company: Company&#123;name: &quot;字节跳动&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;深圳市&quot;&#125;), (company: Company&#123;name: &quot;华为&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;深圳市&quot;&#125;), (company: Company&#123;name: &quot;腾讯&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br><span class="line">match (city: City&#123;name: &quot;深圳市&quot;&#125;), (company: Company&#123;name: &quot;招商银行&quot;&#125;) create (company) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city);</span><br></pre></td></tr></table></figure>

<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_01-07-02.png"></p>
<p>事实上，我们还可以用如下命令来实现关系的新建：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">create (company: Company&#123;name: &quot;阿里&quot;&#125;) -[r:belongTo&#123;name: &quot;所在城市&quot;&#125;]-&gt; (city:City&#123;name: &quot;杭州市&quot;&#125;);</span><br></pre></td></tr></table></figure>



<h4 id="Update"><a href="#Update" class="headerlink" title="Update"></a>Update</h4><p>如果需要更新某个节点的属性，命令如下（比如将上海市节点的简称新增“魔都”这个名字）:</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">MATCH (city:City)</span><br><span class="line">WHERE city.name=&quot;上海市&quot;</span><br><span class="line">SET city.alias=[&quot;沪&quot;, &quot;申&quot;, &quot;魔都&quot;]</span><br><span class="line">RETURN city;</span><br></pre></td></tr></table></figure>

<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_01-08-18.png"></p>
<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_01-09-16.png"></p>
<h4 id="Delete"><a href="#Delete" class="headerlink" title="Delete"></a>Delete</h4><p>CQL 的删除命令有 delete 和 remove，两者的区别为：</p>
<ul>
<li>delete 命令为删除节点、删除节点及相关节点和关系；</li>
<li>remove 命令为删除节点或关系的标签、删除节点或关系的属性</li>
</ul>
<p>我们以删除上海市节点的alias属性为例，命令如下：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">MATCH (city: City&#123;name: &quot;上海市&quot;&#125;)</span><br><span class="line">REMOVE city.alias</span><br><span class="line">RETURN city;</span><br></pre></td></tr></table></figure>

<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_01-11-32.png"></p>
<p>注意，当我们在删除某个节点的时候，需要确定该节点无其他节点无关系相连，即该节点为孤立节点，否则，就会报错！</p>
<h4 id="Select"><a href="#Select" class="headerlink" title="Select"></a>Select</h4><p>CQL的查询语句是灵活、功能强大的。我们仅介绍简单的几个命令。</p>
<p>查询所有的节点：</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (n) return (n);</span><br></pre></td></tr></table></figure>

<p>查询所有节点的数量</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (n) return count(n);</span><br></pre></td></tr></table></figure>

<p>查询所有的Company节点</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (n:Company) return (n);</span><br></pre></td></tr></table></figure>

<p>查询名字为北京市的City节点</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (n:City&#123;name: &quot;北京市&quot;&#125;) return (n);</span><br></pre></td></tr></table></figure>

<p>查询招商银行与深圳市的关系</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (a:Company&#123;name: &quot;招商银行&quot;&#125;) -[r]-&gt; (b:City&#123;name: &quot;深圳市&quot;&#125;) return type(r); </span><br></pre></td></tr></table></figure>

<p>查询该图谱中杭州市下面的Company</p>
<figure class="highlight plaintext"><table><tr><td class="code"><pre><span class="line">match (a:Company) -[r:belongTo]-&gt; (b:City&#123;name: &quot;杭州市&quot;&#125;) return (a); </span><br></pre></td></tr></table></figure>

<hr>
<h3 id="Springboot-集成-Neo4j"><a href="#Springboot-集成-Neo4j" class="headerlink" title="Springboot 集成 Neo4j"></a>Springboot 集成 Neo4j</h3><blockquote>
<p><strong><font color=#FF8C00>SpringBoot 版本为 2.3.0.RELEASE</font></strong></p>
</blockquote>
<h4 id="引入-Neo4j-的-POM-依赖"><a href="#引入-Neo4j-的-POM-依赖" class="headerlink" title="引入 Neo4j 的 POM 依赖"></a>引入 Neo4j 的 POM 依赖</h4><figure class="highlight xml"><table><tr><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">dependency</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">groupId</span>&gt;</span>org.springframework.boot<span class="tag">&lt;/<span class="name">groupId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">artifactId</span>&gt;</span>spring-boot-starter-data-neo4j<span class="tag">&lt;/<span class="name">artifactId</span>&gt;</span></span><br><span class="line">    <span class="tag">&lt;<span class="name">version</span>&gt;</span>2.2.2.RELEASE<span class="tag">&lt;/<span class="name">version</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;/<span class="name">dependency</span>&gt;</span></span><br></pre></td></tr></table></figure>



<h4 id="添加配置文件"><a href="#添加配置文件" class="headerlink" title="添加配置文件"></a>添加配置文件</h4><figure class="highlight properties"><table><tr><td class="code"><pre><span class="line"><span class="attr">spring.data.neo4j.uri</span>=<span class="string">bolt://localhost:7687</span></span><br><span class="line"><span class="attr">spring.data.neo4j.username</span>=<span class="string">neo4j</span></span><br><span class="line"><span class="attr">spring.data.neo4j.password</span>=<span class="string">123456</span></span><br></pre></td></tr></table></figure>



<h4 id="创建-UserNode"><a href="#创建-UserNode" class="headerlink" title="创建 UserNode"></a>创建 UserNode</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">//表示节点类型</span></span><br><span class="line"><span class="meta">@NodeEntity(label=&quot;User&quot;)</span></span><br><span class="line"><span class="meta">@Data</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">UserNode</span> &#123;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Id</span></span><br><span class="line">    <span class="keyword">private</span> Long nodeId;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Property</span></span><br><span class="line">    <span class="keyword">private</span> String userId;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Property</span></span><br><span class="line">    <span class="keyword">private</span> String name;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Property</span></span><br><span class="line">    <span class="keyword">private</span> <span class="type">int</span> age;</span><br><span class="line">    </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="创建-Relation"><a href="#创建-Relation" class="headerlink" title="创建 Relation"></a>创建 Relation</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="comment">//表示关系类型</span></span><br><span class="line"><span class="meta">@RelationshipEntity(type=&quot;UserRelation&quot;)</span></span><br><span class="line"><span class="meta">@Data</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">UserRelation</span> &#123;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Id</span></span><br><span class="line">    <span class="keyword">private</span> Long id;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@StartNode</span></span><br><span class="line">    <span class="keyword">private</span> UserNode startNode;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@EndNode</span></span><br><span class="line">    <span class="keyword">private</span> UserNode endNode;</span><br><span class="line">&#125;</span><br><span class="line"></span><br></pre></td></tr></table></figure>



<h4 id="创建UserRepository"><a href="#创建UserRepository" class="headerlink" title="创建UserRepository"></a>创建UserRepository</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="meta">@Component</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">interface</span> <span class="title class_">UserRepository</span> <span class="keyword">extends</span> <span class="title class_">Neo4jRepository</span>&lt;UserNode,Long&gt; &#123;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 查询所有节点</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@return</span></span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="meta">@Query(&quot;MATCH (n:User) RETURN n &quot;)</span></span><br><span class="line">    List&lt;UserNode&gt; <span class="title function_">getUserNodeList</span><span class="params">()</span>;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 创建节点</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> userId</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> name</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> age</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@return</span></span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="meta">@Query(&quot;create (n:User&#123;userId:$userId,age:$age,name:$name&#125;) RETURN n &quot;)</span></span><br><span class="line">    List&lt;UserNode&gt; <span class="title function_">addUserNodeList</span><span class="params">(<span class="meta">@Param(&quot;userId&quot;)</span> String userId,<span class="meta">@Param(&quot;name&quot;)</span> String name, <span class="meta">@Param(&quot;age&quot;)</span><span class="type">int</span> age)</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="创建-UserRelationRepository"><a href="#创建-UserRelationRepository" class="headerlink" title="创建 UserRelationRepository"></a>创建 UserRelationRepository</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"></span><br><span class="line"><span class="meta">@Component</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">interface</span> <span class="title class_">UserRelationRepository</span> <span class="keyword">extends</span> <span class="title class_">Neo4jRepository</span>&lt;UserRelation,Long&gt; &#123;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 通过id 查询关系</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> firstUserId</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> secondUserId</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@return</span></span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="meta">@Query(&quot;match p=(n:User)&lt;-[r:FRIEND]-&gt;(n1:User) where n.userId=$firstUserId and n1.userId=$secondUserId return p&quot;)</span></span><br><span class="line">    List&lt;UserRelation&gt; <span class="title function_">findUserRelationByEachId</span><span class="params">(<span class="meta">@Param(&quot;firstUserId&quot;)</span> String firstUserId, <span class="meta">@Param(&quot;secondUserId&quot;)</span> String secondUserId)</span>;</span><br><span class="line"></span><br><span class="line">    <span class="comment">/**</span></span><br><span class="line"><span class="comment">     * 添加关系</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> firstUserId</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@param</span> secondUserId</span></span><br><span class="line"><span class="comment">     * <span class="doctag">@return</span></span></span><br><span class="line"><span class="comment">     */</span></span><br><span class="line">    <span class="meta">@Query(&quot;match (fu:User),(su:User) where fu.userId=$firstUserId and su.userId=$secondUserId create p=(fu)-[r:FRIEND]-&gt;(su) return p&quot;)</span></span><br><span class="line">    List&lt;UserRelation&gt; <span class="title function_">addUserRelation</span><span class="params">(<span class="meta">@Param(&quot;firstUserId&quot;)</span> String firstUserId, <span class="meta">@Param(&quot;secondUserId&quot;)</span> String secondUserId)</span>;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="创建-UserService"><a href="#创建-UserService" class="headerlink" title="创建 UserService"></a>创建 UserService</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="meta">@Service</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">UserService</span> &#123;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Autowired</span></span><br><span class="line">    <span class="keyword">private</span> UserRepository userRepository;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Autowired</span></span><br><span class="line">    <span class="keyword">private</span> UserRelationRepository userRelationRepository;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">addUserNode</span><span class="params">(UserNode userNode)</span> &#123;</span><br><span class="line">        userRepository.addUserNodeList(userNode.getUserId(),userNode.getName(), userNode.getAge());</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">addRelationship</span><span class="params">(String firstId,String secondId)</span>&#123;</span><br><span class="line">        userRelationRepository.addUserRelation(firstId,secondId);</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">void</span> <span class="title function_">findUserRelationByEachId</span><span class="params">(String firstId,String secondId)</span>&#123;</span><br><span class="line">        userRelationRepository.findUserRelationByEachId(firstId, secondId);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="创建-Neo4jController"><a href="#创建-Neo4jController" class="headerlink" title="创建 Neo4jController"></a>创建 Neo4jController</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="meta">@RestController</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Neo4jController</span> &#123;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@Autowired</span></span><br><span class="line">    <span class="keyword">private</span> UserService userService;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@RequestMapping(&quot;/saveUser&quot;)</span></span><br><span class="line">    <span class="keyword">public</span> String <span class="title function_">saveUserNode</span><span class="params">(<span class="meta">@RequestParam(&quot;user_id&quot;)</span> String userId,</span></span><br><span class="line"><span class="params">                               <span class="meta">@RequestParam(&quot;user_name&quot;)</span> String userName)</span> &#123;</span><br><span class="line">        <span class="type">UserNode</span> <span class="variable">node</span> <span class="operator">=</span> <span class="keyword">new</span> <span class="title class_">UserNode</span>();</span><br><span class="line">        node.setNodeId(<span class="number">1L</span>);</span><br><span class="line">        node.setUserId(userId);</span><br><span class="line">        node.setName(userName);</span><br><span class="line">        node.setAge(<span class="number">26</span>);</span><br><span class="line"></span><br><span class="line">        userService.addUserNode(node);</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;success&quot;</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    <span class="meta">@RequestMapping(&quot;/addship&quot;)</span></span><br><span class="line">    <span class="keyword">public</span> String <span class="title function_">saveShip</span><span class="params">(<span class="meta">@RequestParam(&quot;user_id_first&quot;)</span> String userIdFirst,</span></span><br><span class="line"><span class="params">                           <span class="meta">@RequestParam(&quot;user_id_second&quot;)</span> String userIdSecond)</span>&#123;</span><br><span class="line">        userService.addRelationship(userIdFirst,userIdSecond);</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;success&quot;</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">    <span class="meta">@RequestMapping(&quot;/findShip&quot;)</span></span><br><span class="line">    <span class="keyword">public</span> String <span class="title function_">findShip</span><span class="params">()</span>&#123;</span><br><span class="line">        userService.findUserRelationByEachId(<span class="string">&quot;1&quot;</span>,<span class="string">&quot;2&quot;</span>);</span><br><span class="line">        <span class="keyword">return</span> <span class="string">&quot;success&quot;</span>;</span><br><span class="line">    &#125;</span><br><span class="line"></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="启动类添加注解"><a href="#启动类添加注解" class="headerlink" title="启动类添加注解"></a>启动类添加注解</h4><figure class="highlight java"><table><tr><td class="code"><pre><span class="line"><span class="meta">@SpringBootApplication</span></span><br><span class="line"><span class="meta">@EnableNeo4jRepositories(basePackages=&quot;com.ase.neo4j.repository&quot;)</span></span><br><span class="line"><span class="meta">@EntityScan(basePackages=&quot;com.ase.neo4j.entity&quot;)</span></span><br><span class="line"><span class="keyword">public</span> <span class="keyword">class</span> <span class="title class_">Neo4jApplication</span> &#123;</span><br><span class="line">    <span class="keyword">public</span> <span class="keyword">static</span> <span class="keyword">void</span> <span class="title function_">main</span><span class="params">(String[] args)</span> &#123;</span><br><span class="line">        SpringApplication.run(Neo4jApplication.class, args);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h4 id="启动测试"><a href="#启动测试" class="headerlink" title="启动测试"></a>启动测试</h4><p>分别添加两个 User，这里我测试数据为张三、李四，id 分别为 001，002</p>
<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_02-15-16.png"></p>
<p>添加关系，将 UserId 为 001 和 002 两个节点添加 friend 的关系</p>
<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_02-15-27.png"></p>
<p>访问路径：<a target="_blank" rel="noopener" href="http://localhost:7474/browser/">http://localhost:7474/browser/</a> ，成功~</p>
<p><img src="https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@master/img/all/Snipaste_2021-09-01_02-20-06.png"></p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://curry3035.gitee.io">PaulGeorge</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://curry3035.gitee.io/posts/3633/">https://curry3035.gitee.io/posts/3633/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://curry3035.gitee.io" target="_blank">Celts</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/Neo4j/">Neo4j</a><a class="post-meta__tags" href="/tags/NoSQl/">NoSQl</a></div><div class="post_share"><div class="social-share" data-image="/img/avatar.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/posts/26019/" title="实践一下--Redis集群"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">实践一下--Redis集群</div></div></a></div><div class="next-post pull-right"><a href="/posts/44995/" title="实践一下--Dubbo"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">实践一下--Dubbo</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">PaulGeorge</div><div class="author-info__description">很多事情就像是旅行一样，当你决定要出发的时候，最困难的那部分其实就已经完成了</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">97</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">64</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">25</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/PaulGeorge123"><i class="fab fa-github"></i><span>GitHub URL</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/PaulGeorge123" target="_blank" title="Github"><i class="fab fa-github"></i></a></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content is-expand"><ol class="toc"><li class="toc-item toc-level-3"><a class="toc-link" href="#Neo4j-%E4%BB%8B%E7%BB%8D"><span class="toc-number">1.</span> <span class="toc-text">Neo4j 介绍</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Neo4j-%E6%98%AF%E4%BB%80%E4%B9%88"><span class="toc-number">1.1.</span> <span class="toc-text">Neo4j 是什么</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Neo4j-%E6%A6%82%E8%A7%88"><span class="toc-number">1.2.</span> <span class="toc-text">Neo4j 概览</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Neo4j-%E4%BD%BF%E7%94%A8-Cypher"><span class="toc-number">2.</span> <span class="toc-text">Neo4j 使用 [Cypher]</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Add"><span class="toc-number">2.1.</span> <span class="toc-text">Add</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Update"><span class="toc-number">2.2.</span> <span class="toc-text">Update</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Delete"><span class="toc-number">2.3.</span> <span class="toc-text">Delete</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Select"><span class="toc-number">2.4.</span> <span class="toc-text">Select</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Springboot-%E9%9B%86%E6%88%90-Neo4j"><span class="toc-number">3.</span> <span class="toc-text">Springboot 集成 Neo4j</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%BC%95%E5%85%A5-Neo4j-%E7%9A%84-POM-%E4%BE%9D%E8%B5%96"><span class="toc-number">3.1.</span> <span class="toc-text">引入 Neo4j 的 POM 依赖</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%B7%BB%E5%8A%A0%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6"><span class="toc-number">3.2.</span> <span class="toc-text">添加配置文件</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-UserNode"><span class="toc-number">3.3.</span> <span class="toc-text">创建 UserNode</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-Relation"><span class="toc-number">3.4.</span> <span class="toc-text">创建 Relation</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BAUserRepository"><span class="toc-number">3.5.</span> <span class="toc-text">创建UserRepository</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-UserRelationRepository"><span class="toc-number">3.6.</span> <span class="toc-text">创建 UserRelationRepository</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-UserService"><span class="toc-number">3.7.</span> <span class="toc-text">创建 UserService</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%88%9B%E5%BB%BA-Neo4jController"><span class="toc-number">3.8.</span> <span class="toc-text">创建 Neo4jController</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8%E7%B1%BB%E6%B7%BB%E5%8A%A0%E6%B3%A8%E8%A7%A3"><span class="toc-number">3.9.</span> <span class="toc-text">启动类添加注解</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E5%90%AF%E5%8A%A8%E6%B5%8B%E8%AF%95"><span class="toc-number">3.10.</span> <span class="toc-text">启动测试</span></a></li></ol></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/47231/" title="POI读取Excel问题">POI读取Excel问题</a><time datetime="2023-04-11T01:00:00.000Z" title="发表于 2023-04-11 09:00:00">2023-04-11</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/8422/" title="Excel大文件的上传">Excel大文件的上传</a><time datetime="2023-04-10T01:00:00.000Z" title="发表于 2023-04-10 09:00:00">2023-04-10</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/55119/" title="每日一面--Files工具类">每日一面--Files工具类</a><time datetime="2023-01-01T01:00:00.000Z" title="发表于 2023-01-01 09:00:00">2023-01-01</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/34600/" title="面试一下--JUC入门">面试一下--JUC入门</a><time datetime="2022-09-10T01:00:00.000Z" title="发表于 2022-09-10 09:00:00">2022-09-10</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/16284/" title="每日一面--字符流和字节流">每日一面--字符流和字节流</a><time datetime="2022-07-01T01:00:00.000Z" title="发表于 2022-07-01 09:00:00">2022-07-01</time></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://gcore.jsdelivr.net/gh/PaulGeorge123/cloudimg@img/mig2023/background05.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By PaulGeorge</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js"></script></div></body></html>